package com.mysteel.common.validation;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * ProjectName: mail
 * ClassName: ListValue
 * Description:
 * date: 2021/01/04/004 16:19
 *
 * @author xiaochao
 */
@Documented
// 将校验注解和校验器关联  validatedBy = {ListValueConstraintValidator.class}，可以指定多个校验器，容器会自动适配
@Constraint(
        validatedBy = {ListValueConstraintValidator.class}
)
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER, ElementType.TYPE_USE})
@Retention(RetentionPolicy.RUNTIME)
public @interface ListValue {
    String message() default "{com.mysteel.common.validation.ListValue.message}";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

    int[] vals() default {};
}
